<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //1 打印100以内的奇数

    for(var i = 1; i <= 100; i++) {
        if(i % 2 != 0) {
            //奇数
            document.write(i + '<br>');
        }
    }

    //6 打印100以内所有偶数的和
    var sum = 0;//存放偶数和
    for(var i = 1; i <= 100; i++) {
        if(i % 2 == 0) {
            //偶数
            sum += i;//累加
        }
    }

    document.write('100以内所有偶数的和是：' + sum);
</script>
</html>